#@embedLayout()

#define content()

<form id="formIdExt" method="post"  accept-charset="UTF-8">
    <input type="hidden" id="isDisplay" name="isDisplay" value="#(isDisplay??)">
    <input type="hidden" id="displayName" name="displayName" value="#(displayName??)">

    <input type="hidden" id="dictId" name="dict.dict_id" value="#(dict.dictId??)">
    <table class="table table-bordered">

        <tr #if(isDisplay == "0") style="display: none;" #end>
            <td style="padding-top:15px;">#(displayName)类型:</td>
            <td>
                <select name="dict.dt_id" id="dtId" class="easyui-combobox" data-options="editable:false" style="width: 98%;">
                    #for(dictType : dictTypes)
                    <option value="#(dictType.dtId??)" #if(dictType.dtId?? == dict.dtId??) selected #end>#(dictType.dtName??)</option>
                    #end
                </select>
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">#(displayName)名称:</td>
            <td>
                <input type="text" id="dictName" name="dict.dict_name" class="easyui-textbox" data-options="required:true,validType:{length:[1,150]}" value="#(dict.dict_name??)"  style="width: 98%;">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">#(displayName)内容:</td>
            <td>
                <input type="text" class="easyui-textbox" id="dictText" name="dict.dict_text" data-options="required:true,validType:{length:[0,500]},multiline:true" value="#(dict.dict_text??)" style="width:98%;height:150px;">
            </td>
        </tr>

        <tr #if(isDisplay == "0") style="display: none;" #end>
            <td style="padding-top:15px;">是否启用:</td>
            <td>
                <select name="dict.is_enable" id="isEnable" class="easyui-combobox" data-options="editable:false" style="width: 98%;">
                    <option value="1" #if(dict.isEnable?? == "1") selected #end>启用</option>
                    <option value="0" #if(dict.isEnable?? == "0") selected #end>不启用</option>
                </select>
            </td>
        </tr>
        <tr #if(isDisplay == "0") style="display: none;" #end>
            <td style="padding-top:15px;">备用字段1:</td>
            <td>
                <input type="text" class="easyui-textbox" id="data1" name="dict.data1" value="#(dict.data1??)" style="width: 98%;">
            </td>
        </tr>

        <tr #if(isDisplay == "0") style="display: none;" #end>
            <td style="padding-top:15px;">备用字段2:</td>
            <td>
                <input type="text" class="easyui-textbox" id="data2" name="dict.data2" value="#(dict.data2??)" style="width: 98%;">
            </td>
        </tr>
        <tr #if(isDisplay == "0") style="display: none;" #end>
            <td style="padding-top:15px;">排序:</td>
            <td>
                <input type="text" class="easyui-numberbox easyui-tooltip" title="只能输入数字" id="orderNumber" name="dict.order_number" value="#(dict.order_number??)" style="width: 98%;">
            </td>
        </tr>
        <tr #if(isDisplay == "0") style="display: none;" #end>
            <td style="padding-top:15px;">#(_res.get('user.form.des')):</td>
            <td style="padding-top:12px;">
                <input type="text" class="easyui-textbox" id="des" name="dict.des" data-options="validType:{length:[0,500]},multiline:true" value="#(dict.des??)" style="width:98%;height:150px;">
            </td>
        </tr>
    </table>
</form>

#end


#define css()


#end


#define js()

<script type="text/javascript">
    function dict_datagrid_save(opr_type) {

        var url = '';
        if (opr_type == 'add') {
            url = contextRootPath + '/dict/save';
        } else {
            url = contextRootPath + '/dict/update';
        }

        $('#formIdExt').form('submit', {
            url: url,
            onSubmit: function () {
                var flag = $(this).form('enableValidation').form('validate');
                if (flag) {
                    showProcess(true, '温馨提示', '正在提交数据...');
                }
                return flag;
            },
            success: function (data) {
                showProcess(false);
                var params = {};
                params.element = _datagridExt;
                params.dlgId="dict_ext_form_dlg_id";
                params.data = data;
                resultCallback(params);
            },
            onLoadError: function () {
                showProcess(false);
                $.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
            }
        });
    }

</script>

#end


